﻿@{
    ViewBag.Title = "目标计划";
    Layout = "~/Views/Shared/_Layout.cshtml";
    string s = ViewBag.M;
    var Cols = new Jw.Models.p_ZlmbjhService().GetHiddenColumns(s);
}

@section scripts{
        <script src="~/Areas/Pacm/js/Pacm.mbjh.js" type="text/javascript"></script>
        <script type="text/javascript">
            using("lookup", easyuifix.datagrid_editor_extend); //动态载入这些组件
            using(['validatebox','combotree','numberbox','datebox'],easyuifix.datagrid_editor_extend);
            var data = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model));
            ko.bindingViewModel(new viewModel(data));
        </script>
}
  <div class="z-toolbar">
        <a id="a_refresh" href="#" plain="true" class="easyui-linkbutton" icon="icon-arrow_refresh" title="刷新" data-bind="click:refreshClick">刷新</a>
        <a id="a_add"    href="#" plain="true" class="easyui-linkbutton" icon="icon-add" title="新增" data-bind="click:addClick">新增</a>
        <a id="a_edit"   href="#" plain="true" class="easyui-linkbutton" icon="icon-edit" data-bind="click:editClick" title="编辑">编辑</a>
        <a id="a_del"    href="#" plain="true" class="easyui-linkbutton" icon="icon-cross" title="删除" data-bind="click:deleteClick">删除</a>
        <a id="a_save"  href="#" plain="true" class="easyui-linkbutton" icon="icon-save" data-bind="click:saveClick" title="保存">保存</a>
        <a href="#" plain="true" class="easyui-linkbutton"  icon="icon-user-accept"     title="审核" data-bind="click:auditClick"  >审核</a>
 </div>

<div id="condition" class="container_12" style="position:relative;">
    <div class="grid_1 lbl">计划年份</div>
    <div class="grid_2 val"><input type="text" data-bind="datasource:dataSource.yearsItems ,comboboxValue:form.Info_Year" class="z-txt easyui-combobox" data-options="showblank:true"/></div>
    <div class="grid_1 lbl">计划月份</div>
    <div class="grid_2 val"><input type="text" data-bind="datasource:dataSource.monthItems ,comboboxValue:form.Info_Month" class="z-txt easyui-combobox" data-options="showblank:true"/></div>
    @*<div class="grid_1 lbl">计划部门</div>
    <div class="grid_2 val"><input type="text" data-bind="datasource:dataSource.cjItems ,comboboxValue:form. Mbjh_cjItems" class="z-txt easyui-combobox" data-options="showblank:true"/></div>*@
    <div class="clear"></div>
    <div class="grid_1 lbl">录入日期</div>
    <div class="grid_2 val"><input type="text" data-bind="value:form.CreateDate" class="z-txt easyui-daterange"/></div>
    <div class="clear"></div>
    <div class="prefix_9" style="position:absolute;top:5px;height:0;">  
        <a id="a_search" href="#" class="button button-blue" style="margin:0 15px;" data-bind="click:searchClick">查询</a> 
        @*<a id="a_reset" href="#" class="button button-blue" data-bind="click:clearClick">清空</a>*@
    </div>
</div>

<table id="gridlist" data-bind="treegrid:grid">
    <thead>  
    <tr>  
        <th field="Zlmbjh_BillNo"    editor="text" sortable="true" align="left"    width="90"  >流水号   </th>  
        <th field="Zlmbjh_Year"     editor="text" sortable="true" align="left"    width="70"  >计划年度     </th>  
        <th field="Zlmbjh_Month"    editor="text" sortable="true" align="left"    width="70"  >计划月份     </th>  
        <th field="Zlmbjh_Dwid"     editor="{type:'lookup',options:{lookupType:'organize',parentField:'pid'}}" sortable="true" align="left"    width="70"   >单位编号   </th> 
        @if (s == "1") 
        {
            <th field="Zlmbjh_A199D"    editor="{type:'numberbox',options:{precision:2}}" sortable="true" align="right"    width="150"  >原铝质量A199.70以上率</th>  
            <th field="Zlmbjh_A199X"   editor="{type:'numberbox',options:{precision:2}}" sortable="true" align="right"    width="150" >原铝质量A199.60以上率     </th> 
        }
        else if (s == "2")
        {
            <th field="Zlmbjh_A199D"  editor="{type:'numberbox',options:{precision:2}}" sortable="true" align="right"    width="150"  >铝锭质量Al99.70以上率   </th>  
            <th field="Zlmbjh_A199X"   editor="{type:'numberbox',options:{precision:2}}" sortable="true" align="right"    width="150" >  成品铝质量Al99.60以上率   </th>
            <th field="Zlmbjh_Jyhgl"   editor="{type:'numberbox',options:{precision:2}}" sortable="true" align="right"    width="120"  >铸造一次检验合格率  </th>  
            <th field="Zlmbjh_Cchgl"   editor="{type:'numberbox',options:{precision:2}}" sortable="true" align="right"    width="90" >  出厂合格率  </th>

        }
        else if (s == "3")
        {
        
            <th field="Zlmbjh_Zzhgl"  editor="{type:'numberbox',options:{precision:2}}"  sortable="true" align="right"    width="120"  >一次组装合格率    </th>  
            <th field="Zlmbjh_Pbhgl"   editor="{type:'numberbox',options:{precision:2}}"   sortable="true" align="right"    width="90" >  磷生铁配比合格率   </th> 
        }
        <th field="Zlmbjh_Remark"  editor="text"  sortable="true" align="left"    width="150" >备注       </th> 
        <th field="CreateDate"     sortable="true" align="center"  width="70"  formatter="com.formatDate" >编制日期   </th>  
        <th field="CreatePerson"   sortable="true" align="left"    width="150" >编制人       </th>   
          
    </tr>                            
</thead>      
</table> 
